package com.museum.controller;

import com.alibaba.fastjson.JSONObject;
import com.museum.base.BaseApiService;
import com.museum.base.BaseResponse;
import com.museum.controller.APi.ConfirmControllerAPI;
import com.museum.entity.DTO.CommitCol;
import com.museum.entity.DTO.QueryPrice;
import com.museum.service.impl.ConfirmServiceImpl;
import com.museum.service.impl.PriceServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LB
 * @version 1.0
 * @date 2021/1/18 11:05
 */
@RestController
@RequestMapping("/confirm")
public class ConfirmController extends BaseApiService<JSONObject> implements ConfirmControllerAPI {
    @Autowired
    private ConfirmServiceImpl confirmService;
    @Override
    public BaseResponse<JSONObject> ClueControllerAPI(long current, long limit, QueryPrice queryPrice) {
        JSONObject json = confirmService.getAllColByPage(current,limit,queryPrice);
        return setResultSuccess(json);
    }

    @Override
    public BaseResponse<JSONObject> ConfirmcommitCol(CommitCol commitCol, HttpServletRequest request) {
        int result =  confirmService.commitCol(commitCol,request);
        if(result>0){
            return setResultSuccess("审核完成");
        }else{
            return setResultError("审核失败,系统错误");
        }
    }





}
